# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataproc.V1.Model.NativeSqlExecutionUiData do
  @moduledoc """
  Native SQL Execution Data

  ## Attributes

  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. Description of the execution.
  *   `executionId` (*type:* `String.t`, *default:* `nil`) - Required. Execution ID of the Native SQL Execution.
  *   `fallbackDescription` (*type:* `String.t`, *default:* `nil`) - Optional. Description of the fallback.
  *   `fallbackNodeToReason` (*type:* `list(GoogleApi.Dataproc.V1.Model.FallbackReason.t)`, *default:* `nil`) - Optional. Fallback node to reason.
  *   `numFallbackNodes` (*type:* `integer()`, *default:* `nil`) - Optional. Number of nodes fallen back to Spark.
  *   `numNativeNodes` (*type:* `integer()`, *default:* `nil`) - Optional. Number of nodes in Native.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :description => String.t() | nil,
          :executionId => String.t() | nil,
          :fallbackDescription => String.t() | nil,
          :fallbackNodeToReason => list(GoogleApi.Dataproc.V1.Model.FallbackReason.t()) | nil,
          :numFallbackNodes => integer() | nil,
          :numNativeNodes => integer() | nil
        }

  field(:description)
  field(:executionId)
  field(:fallbackDescription)
  field(:fallbackNodeToReason, as: GoogleApi.Dataproc.V1.Model.FallbackReason, type: :list)
  field(:numFallbackNodes)
  field(:numNativeNodes)
end

defimpl Poison.Decoder, for: GoogleApi.Dataproc.V1.Model.NativeSqlExecutionUiData do
  def decode(value, options) do
    GoogleApi.Dataproc.V1.Model.NativeSqlExecutionUiData.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Dataproc.V1.Model.NativeSqlExecutionUiData do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
